package com.tosit.driverschool.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@Controller
public class CommonCtroller {
    /**
     * 配置默认首页!!
     * @param modelMap
     * @return
     */
    @GetMapping("/")
    public String index(ModelMap modelMap) {
        return "redirect:/user/getAll";
    }

    /**
     * 跳转到静态界面的中转方法
     * @param path
     * @return
     */

    @GetMapping("/user/p/{path}")
    public String toPage(@PathVariable("path") String path){
        return "/page/"+path;
    }
}
